package com.xr50.user.controller;

import com.xr50.common.SaveRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class UserController {

    @GetMapping("is/who")
    public String idWho(HttpServletRequest httpServletRequest) {
        return "我是 user " + httpServletRequest.getServerName() + ":" + httpServletRequest.getServerPort();
    }


    @PostMapping("save")
    public String save(@RequestBody SaveRequest name) {

        return "user   我保存了" + name;

    }

}
